package com.kalvan.client.constant;

import com.kalvan.client.exception.ReturnCode;

/**
 * 系统返回码定义
 * 系统编号1-9、a-z、A-Z
 * 00xx 通用公共码定义,如果需要扩展和覆盖可以把第一位重写
 * {{系统编号}}1xx 请求异常
 * {{系统编号}}2xx 参数异常
 * {{系统编号}}3xx 数据异常
 *
 * @author chenliang
 */
public interface CommonReturnCode {
    /**
     * {{系统编号}}0xx 处理结果返回
     */
    ReturnCode SUCCESS = new ReturnCode("0000", "处理成功{0}");
    ReturnCode OVERTIME = new ReturnCode("0001", "处理超时{0}");
    ReturnCode CONFIRM = new ReturnCode("0002", "待验证,请提交验证信息继续操作");
    ReturnCode SUCCESS_IMPORT = new ReturnCode("0003", "成功新增{0}行数据");
    ReturnCode SUCCESS_UPDATE = new ReturnCode("0004", "成功更新{0}行数据");
    ReturnCode SUCCESS_DELETE = new ReturnCode("0005", "成功删除{0}行数据");
    ReturnCode SUCCESS_AUDITING = new ReturnCode("0006", "成功审核{0}行数据");
    ReturnCode FAIL = new ReturnCode("0097", "处理失败{0}");
    ReturnCode ERROR = new ReturnCode("0098", "系统异常,请稍候再试{0}");
    ReturnCode FALLBACK = new ReturnCode("0099", "FALLBACK");
    /**
     * {{系统编号}}1xx 请求异常
     */
    ReturnCode REQUEST_FREQ = new ReturnCode("0100", "请求频率过高{0}");
    ReturnCode REQUEST_ILLEGAL = new ReturnCode("0101", "请求非法{0}");
    ReturnCode REQUEST_SERVICE_NOT_FOUND = new ReturnCode("0102", "服务未找到{0}");
    ReturnCode REQUEST_TIME_OUT = new ReturnCode("0103", "请求超时");
    ReturnCode REQUEST_APP_ILLEGAL = new ReturnCode("0104", "请求appId非法{0}");
    ReturnCode REQUEST_IP_ILLEGAL = new ReturnCode("0105", "请求ip非法{0}");
    ReturnCode REQUEST_DOMAIN_ILLEGAL = new ReturnCode("0106", "请求域名非法{0}");
    ReturnCode REQUEST_NOT_PERMISSION = new ReturnCode("0107", "{0}无权限访问{1}");
    ReturnCode REQUEST_SERVICE_NOT_SUPPORT = new ReturnCode("0108", "系统不支持该服务{0}");
    ReturnCode REQUEST_NO_LOGIN = new ReturnCode("0109", "未登录");
    /**
     * {{系统编号}}2xx 参数异常
     */
    ReturnCode PARAM_ILLEGAL = new ReturnCode("0200", "请求参数有误{0}");
    ReturnCode PARAM_NOT_NULL = new ReturnCode("0201", "{0}参数不能为空");
    ReturnCode PARAM_VALIDATE_ERROR = new ReturnCode("0202", "{0}");
    ReturnCode PARAM_REGION_OVER = new ReturnCode("0203", "{0}超过范围{1}");
    /**
     * {{系统编号}}3xx 数据异常
     * 查询db结果后产生的异常如状态异常、记录不存在
     */
    ReturnCode DATA_QUERY_ERROR = new ReturnCode("0300", "数据查询异常,请稍后查询");
    ReturnCode DATA_SAVE_ERROR = new ReturnCode("0301", "数据更新异常");
    ReturnCode DATA_NOT_EXISTS = new ReturnCode("0302", "{0}记录不存在");
    ReturnCode DATA_REPEAT = new ReturnCode("0303", "{0}记录已存在,请通过查询核实状态");
    ReturnCode DATA_PROCESSING = new ReturnCode("0304", "{0}当前记录存在未完结业务");
    ReturnCode DATA_SELF_AUDIT = new ReturnCode("0305", "{0}不能审核自己提交的记录");
    ReturnCode DATA_STATE_ERROR = new ReturnCode("0306", "{0}当前状态不允许该操作");
}
